<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" />
	<xsl:variable name="city" select="'cadiz'" />
	<xsl:template match="/graphml/graph">
		<graphml>
			<graph>
				<xsl:for-each select="edge">
					<xsl:choose>
						<xsl:when test="@source = $city">
							<xsl:copy-of select="current()" />
						</xsl:when>
						<xsl:when test="@target = $city">
							<xsl:copy-of select="current()" />
						</xsl:when>
					</xsl:choose>
				</xsl:for-each>
			</graph>
		</graphml>
	</xsl:template>
</xsl:stylesheet>